<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<script type="text/javascript">
			// typeof() 判断变量的类型
			var num;// 只有声明，没有赋值，默认值是undefined
			console.log(num);// undefined
			console.log(typeof(num));//undefined
			num = 3.14;
			console.log(num);// undefined
			console.log(typeof(num));//number
			num = 'JS!';
			console.log(num);// JS!
			console.log(typeof(num));//string
			num = true;
			console.log(num);// true
			console.log(typeof(num));//boolean
			num = null;
			console.log(num);// null
			console.log(typeof(num));//object
			
			var m = '3';
			var n = 3;
			if (m == n) {// ==值相等就可以
				console.log('m==n');
			}
			if (m === n) {// ===值相等，类型也要相同
				console.log('m===n');
			}
		</script>
	</body>
</html>
